<?php

namespace app\admin\model\chase;

use think\Model;

class UserVipEquity extends Model
{
    protected $autoWriteTimestamp = false;

    public static function add($user_vip_id, $equities)
    {
        $data = [];
        foreach ($equities as $val) {
            $data[] = [
                'user_vip_id' => $user_vip_id,
                'equity_id' => $val
            ];
        }
        return self::insertAll($data);
    }

    public static function del($user_vip_id)
    {
        return self::where('user_vip_id', $user_vip_id)->delete();
    }

    public static function getEquituIds($user_vip_id)
    {
        return self::where('user_vip_id', $user_vip_id)->column('equity_id');
    }
}
